package org.jsbd.boss.dao.impl;

import java.util.HashMap;
import java.util.Map;

import org.jsbd.boss.common.DataGridModel;
import org.jsbd.boss.dao.ITaskCostDAO;
import org.jsbd.boss.domian.statistics.TaskCostVo;
import org.springframework.stereotype.Repository;

@Repository("taskCostDAO")
public class TaskCostDAOImpl extends CrackStatisticsBaseDao implements ITaskCostDAO {

	@Override
	public Map<String, Object> findListGridJson(DataGridModel page, TaskCostVo taskCostVo) {
		taskCostVo = (taskCostVo == null ? new TaskCostVo() : taskCostVo);
		taskCostVo.setPageInfo(page);
	    Map<String, Object> results = new HashMap<String, Object>();
	    results.put("rows", super.queryForList("qy_task_cost.SELECT_AVG_LIST", taskCostVo));
	    results.put("total", super.queryForCount("qy_task_cost.SELECT_AVG_COUNT", taskCostVo));
	    return results;
	}

	@Override
	public Map<String, Object> findListUserJson(DataGridModel page, TaskCostVo taskCostVo) {
		taskCostVo = (taskCostVo == null ? new TaskCostVo() : taskCostVo);
		taskCostVo.setPageInfo(page);
	    Map<String, Object> results = new HashMap<String, Object>();
	    results.put("rows", super.queryForList("qy_task_cost.SELECT_USER_AVG_LIST", taskCostVo));
	    results.put("total", super.queryForCount("qy_task_cost.SELECT_USER_AVG_COUNT", taskCostVo));
	    return results;
	}

}
